Skip to content

Clarify download_fileobj flush guidance in docs#4736

Open
ReinerBRO wants to merge 1 commit intoboto:developfrom
ReinerBRO:docs/s3-download-fileobj-flush-note-1304
Open

Clarify download_fileobj flush guidance in docs#4736
ReinerBRO wants to merge 1 commit intoboto:developfrom
ReinerBRO:docs/s3-download-fileobj-flush-note-1304

Conversation

@ReinerBRO
Copy link
Copy Markdown

Summary

  • add guidance to download_fileobj docstrings (client, bucket, object) about calling flush() and seek(0) before reading from the same file object
  • update the S3 downloading guide with a concrete download_fileobj example showing flush() + seek(0) in a wb+ context

Why

Issue #1304 highlights that managed multipart downloads can leave the writable file object in a state where immediate reads may appear incomplete unless callers flush and reset the cursor. This PR documents that usage pattern where users are most likely to look for it.

Validation

  • python -m pytest tests/unit/s3/test_inject.py -q
  • python -m ruff check boto3/s3/inject.py

(Attempted sphinx -b dummy docs build locally, but full dummy build stalled in this environment; changes are limited to docstrings and one guide page.)

Fixes #1304

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Better S3 download_fileobj docs, note potential need to call flush() with threaded transfers

1 participant